package myJs.implicits

import org.scalajs.dom.Element
import org.scalajs.dom.raw.HTMLFormElement

import scala.scalajs.js
import scala.scalajs.js.JSON

/**
 * Created by Administrator on 2020/1/16
 */
trait MyJDAnTool {

  implicit class MyJDAn(jd: js.Dictionary[js.Any]) {

    def myGet(key: String) = jd.getOrElse(key, "").toString

    def myGetDouble(key: String) = jd.getOrElse(key, "").toString.toDouble

    def myGetInt(key: String) = jd.getOrElse(key, "").toString.toInt

  }

  implicit class MyJDS(jd: js.Dictionary[String]) {

    def jsonStr = JSON.stringify(jd)

  }

}
